
<template>
  <el-dialog :visible.sync="visible" custom-class="dialog_big" :title="$tt('label_srm_request_record')"
    v-loading="loading">
    <ex_super_desc v-bind="descOption" :data="form">
    </ex_super_desc>
    <!-- <detail_common_new ref="detail_common_new" :descOption="descOption" :url="url" :urlDataHandle="urlDataHandle">
    </detail_common_new> -->
  </el-dialog>
</template>

<script>
// import detail_common_new from '@/component/dialog/detail_common_new'

export default {
  components: {  },
  route_manual:true,

  data() {
    return {
      visible: false,
      loading: false,
      form: {},

      url: '/srm-api/supplier/ApiServiceRequestLogRpc/detail.json',
      urlDataHandle: (res) => {
        return {
          descData: res.data
        }
      },
      descOption: {
        attrs: {
          column: 4, border: true, direction: 'vertical',
          labelClassName: 'widthdiv4', contentClassName: 'widthdiv4'
        },
        model: [
          { key: 'apiPlatformCode', label: 'label_srm_api_request_platform_code', },
          { key: 'apiServiceCode', label: 'label_srm_api_request_api_service_code', },
          { key: 'orderNo', label: 'label_srm_api_order_no', },
          { key: 'businessType', label: 'label_business_type', formatter: (r, c, v, i) => this.$enumShow(v, "ApiCaiNiaoOrderTypeEnum") },
          { key: 'customerCode', label: 'label_srm_api_request_customer_code', },
          { key: 'warehouseCode', label: 'label_srm_api_request_store_code', },
          { key: 'success', label: 'label_srm_api_request_success', formatter: (r, c, v, i) => this.$enumShow(v, "TrueOrFalseEnum") },
          { key: 'errorCode', label: 'label_srm_api_request_error_code', },
          {
            key: 'errorMsg', label: 'label_srm_api_request_error_message',
            render: (h, { data, item }) => {
              const code = data[item.key]
              if (!code) return this.$tt('data_temp_none')
              return (<text_extra_tooltip_operate position_relative
                value={code} ellipsis
                data_type={item.key} data_id={data.id}
              />)
            },
      

          },
          {
            key: 'requiredParameter', label: 'label_srm_request_param',
            render: (h, { data, item }) => {
              const code = data[item.key]
              if (!code) return this.$tt('data_temp_none')
              return (<text_extra_tooltip_operate position_relative
                value={code} ellipsis
                data_type={item.key} data_id={data.id}
              />)
            },
        
          },
          {
            key: 'responseMessage', label: 'label_srm_response_message',
            render: (h, { data, item }) => {
              const code = data[item.key]
              if (!code) return this.$tt('data_temp_none')
              return (<text_extra_tooltip_operate position_relative
                value={code} ellipsis
                data_type={item.key} data_id={data.id}
              />)
            },
          },
        ],
      },

    }
  },
  methods: {
    show({ params, }) {
      this.visible = true

      this.loading = true
      this.$ajax({
        url:this.url,
        method: 'post',
        data: params,
        success: (res) => {
          this.form = res.data
        },
        complete: () => {
          this.loading = false
        }
      })
    },

    hide() {
      this.visible = false
    },
    copyTextToClipboard(message) {
      if (this.$tool.copyTextToClipboard(message)) {
        this.$message.success(this.$tt('label_has_copy'))
      }
    },
  }
}
</script>
